/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Controller;

import database.LoadFromDatabase;
import org.apache.log4j.Logger;

/**
 *
 * @author
 * sdsli5-2
 */
public class MyThreadClass extends Thread{
    boolean shutdown=false;
    public void run()
    {
        shutdown=false;
        try {
             sleep(1000);
             LoadFromDatabase.getInstance().loadServerSettings();
             Logger.getLogger(MyThreadClass.class.getName()).info("server Started");
        } catch (InterruptedException ex) {
            Logger.getLogger(MyThreadClass.class.getName()).fatal(ex);
        }
        while(true)
        {
            if(shutdown)
                break;
            try{
                LoadFromDatabase.getInstance().loadBasicTestSettings();
            
               // System.out.println("sabbir ahmed");
                sleep(300000);
            } catch (InterruptedException ex) {
                Logger.getLogger(MyThreadClass.class.getName()).fatal(ex);
            }
        }
    }

    public void doShutdown() {
        shutdown=true;
    }
}
